/********
 * 试卷信息页面全部接口
 *
 */
import request from "@/utils/request";

/*****
 * 获取 【归属学科】 列表
 */
export const subjectListApi = () =>
  request({
    url: "subject/tree",
    method: "get",
  });

/**********
 * 获取 【试卷信息】 列表
 * params 带问号的参数
 */
export const paperInfoListApi = (params) =>
  request({
    url: "/exam/paper",
    method: "get",
    params,
  });

/*************
 * 创建试卷
 */
export const addPaperInfoListApi = (data) =>
  request({
    url: "/exam/paper",
    method: "post",
    data,
  });

/*************
 * 修改试卷
 */
export const aeditPaperInfoListApi = (data) =>
  request({
    url: "/exam/paper/" + data.id,
    method: "put",
    data,
  });

/*****
 * 选择题目
 */
export const selectPaperInfoApi = (params) =>
  request({
    url: "/exam/question",
    method: "get",
    params,
  });

/*****
 * 切换试卷状态
 */
export const changeStateApi = (paper_id, paper_state) =>
  request({
    url: "/exam/paper/" + paper_id + "/" + paper_state,
    method: "get",
  });

/*****
 * 删除试卷
 */
export const delPaperApi = (id) =>
  request({
    url: "/exam/paper/" + id,
    method: "DELETE",
  });

/*****
 * 查看试卷
 */
export const lookZhuPaperApi = (id) =>
  request({
    url: "/exam/paper/" + id,
    method: "get",
  });
